package com.young.springdemo.service.mediator;

//具体中介者类
public class ConcreateMediator extends Mediator {
    //维持对各个同事的引用
    public Button button;
    public List list;
    public TextBox textBox;
    public ComboBox comboBox;



    @Override
    public void componentChanged(Compoment compoment) {
        if (compoment == button){
            System.out.println("----单击增加按钮----");
            list.update();
            comboBox.update();
            textBox.update();
        }else if (compoment == list){
            System.out.println("----从列表框选择内容----");
            comboBox.select();
            textBox.setText();
        }else if (compoment == comboBox){
            System.out.println("----组合框选择内容----");
            list.select();
            textBox.setText();
        }
    }
}
